package com.cy.sys.service;

import com.cy.sys.dao.SysNoticeDao;
import com.cy.sys.pojo.SysNotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysNoticeServiceImp implements SysNoticeService {
    @Autowired
    private SysNoticeDao sysNoticeDao;


    @Override
    public List<SysNotice> findNotices(SysNotice sysNotice) {
        return sysNoticeDao.selectNotices(sysNotice);
    }

    @Override
    public int saveNotice(SysNotice sysNotice) {
        return sysNoticeDao.insertNotices(sysNotice);
    }

    @Override
    public SysNotice findById(Long id) {
        return sysNoticeDao.selectById(id);
    }

    @Override
    public int updateNotice(SysNotice sysNotice) {
        int rows = sysNoticeDao.updateNotices(sysNotice);
        return rows;
    }

    @Override
    public int deleteById(Long... id) {
        return sysNoticeDao.deleteById(id);
    }
}
